The present embodiments relate to memory management in volume rendering. In GPU- or texture-based volume rendering, a volume dataset is represented as one or more texture objects. The voxel values of the dataset are mapped to colors by texture operations and composited into the frame buffer. For typical viewing parameters in rendering, a large number of voxels are invisible or not needed. For example, the voxels may be insignificant due to a transfer function, view frustum, occlusion, or masking. Such voxels are loaded into memory, requiring time and memory space.
In the simplest case, a whole volume is treated as a single 3D texture. However, a volume dataset may be much larger than the available graphics memory.
The dataset may be partitioned or bricked. The bricking technique partitions a volume into smaller sub-volumes, each referred to as a brick. Only bricks containing visible voxels are loaded into graphics memory. Bricking may avoid some undesired memory transfers and allow visualization of datasets larger than texture memory.
During a volume visualization session, users usually modify viewing parameters to inspect different aspects of a dataset or imaged region. The bricks associated with visible voxels may change accordingly. Such changes may result in unneeded bricks being stored in the texture memory. Additional bricks may need to be transferred into memory, but sufficient memory space may be unavailable without overwriting needed cached bricks or storage in a less optimum memory. Transfer of bricks due to rendering changes may operate inefficiently, especially when the overall dataset is bigger than the texture memory capacity.
A driver controls storage of the bricks. Standard graphics APIs, such OpenGL, request needed data from a driver. A rendering application does not control where texture objects are stored. For example, in case of an out-of-memory condition, the driver for a graphics card may choose to swap some textures to system memory to satisfy new texture memory requests. The swapping may result in rendering delays.